import '../styles/main.css';

import { sayHelloTo } from './modules/mod1';
import addArray from './modules/mod2';


import debug from 'debug';
const log = debug('app:log');

if (ENV !== 'production') {
  debug.enable('*');
  log('Logging is enabled!');
  // Enable LiveReload
  // 注入LiveReload脚本
  document.write(
    '<script src="http://' + (location.host || 'localhost').split(':')[0] +
    ':35729/livereload.js?snipver=1"></' + 'script>'
  );
} else {
  debug.disable();
}


const result1 = sayHelloTo('Jason');
const result2 = addArray([1, 2, 3, 4]);

const printTarget = document.getElementsByClassName('debug__output')[0];
printTarget.innerText = `sayHelloTo('Jason') => ${result1}\n\n`;
printTarget.innerText += `addArray([1, 2, 3, 4]) => ${result2}`;

/** 监听测试 */
console.log('rollup init')